<% @all_post.each do |post| %>
<div class="row-fluid">
    <div class="span12 well">
    	<div class="span1">
	    	<%= image_tag show_avatar(post.user.avatar),:onerror => "this.src='/data/no-image.jpg'", :class => "img-polaroid", :width => "100%" %>
	    </div>
    	<div class="span11">
    		<%= this_owner?(post.user.username, post.post_id) %>
    		<strong><%= link_to post.user.username, another_user_path(post.user_id), :target => '_blank' %></strong><br/>
	    	<span id="content_<%= post.post_id %>"><%= raw post.content %></span>
	    	<div style="clear:both;"></div>
	    	<%= show_date(post.created_at, post.updated_at, post.post_id) %>
	    </div>
	    <div style="clear:both;"></div>
	    <div id="comment_content<%=post.post_id %>">
	    <% if post.comment.size > 0 %>		    
		    <h6>Comment :</h6>
		    <div id="list_comment<%=post.post_id %>" class="list_comment" rel='<%=post.post_id %>'>
		    <% post.comment.each do |comment| %>
		    <div class="row-fluid" id="comment<%= comment.comment_id%>">
			    <div class="span12 well" style="background-color: #E6E6E6;margin:0;">
			    	<div class="span1">
				    	<%= image_tag show_avatar(comment.user.avatar),:onerror => "this.src='/data/no-image.jpg'", :class => "img-polaroid", :width => "100%" %>
				    </div>
			    	<div class="span11">
			    		<% if !@user.nil? && @user.user_id == comment.user.user_id %>
			    		    <div class="btn-group" style="float:right;">
							   <button type="button" class="close" data-pid="<%= post.post_id%>" data-cid="<%= comment.comment_id%>" data-url="<%= del_comment_path %>" style="color:red;">×</button>
						    </div>
						<% end %>
			    		<strong><%= link_to comment.user.username, another_user_path(comment.user_id), :target => '_blank' %></strong><br/>
				    	<span><%= comment.content %></span>
				    	<div style="clear:both;"></div>
				    	 <i style="float:right;font-size:10px;">( <%= change_date(comment.created_at) %> )</i>
				    </div>
			    </div>
			</div>
			<% end %>
			</div>
			<div style="text-align:right;margin-top: 5px;" id="more<%=post.post_id %>" >
				<input type="button" class="btn btn-info" style="" value="+ More" rel='<%=post.post_id %>' />
			</div>
		<% end %>
		</div>
        <% if !@user.nil? %>
        <%= set_comment @user.avatar, @user.username, @user.user_id, post.post_id %>
        <% else %>
        <%= set_comment '', '', '', post.post_id %>
        <% end %>
    </div>
</div>
<% end %>
<% if @all_post.size > 0 %>
<div style='display:none;text-align:center' id='loadingContent'><img src='images/ajax-loader.gif' alt='' width='43' height='11'/><p><i>Loading more post ... </i></p></div>
<input type="hidden" id="postUrl" value="<%= params[:id]?load_another_post_path(params[:id]):load_post_path %>" />
<input type="hidden" id="curPage" value="user" />
<% end %>